package com.vsu.bookstore.mvc.ui.widgets;

import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;

@SuppressWarnings("serial")
public class TablePanel extends Panel
{
  private BookStoreTable table = null;

  public TablePanel(final Object id, final String title)
  {
    final VerticalLayout layout = new VerticalLayout();
    layout.setWidth("100%");
    layout.setHeight(TableContainer.MULTI_TABLE_UNIT_HEIGHT);
    layout.setSpacing(false);
    layout.setMargin(false);
    setWidth("100%");

    table = new BookStoreTable(id, title);
    layout.addComponent(table.getHeaderContents());
    layout.addComponent(table);
    layout.setExpandRatio(table, 1.0f);
    setContent(layout);
    setScrollable(false);


  }

  public BookStoreTable getTable(){return table;}
}
